
<!DOCTYPE html>
<html class="x-admin-sm">
    <head>
        <meta charset="UTF-8">
        <title>欢迎页面-X-admin2.2</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="stylesheet" href="./css/font.css">
        <link rel="stylesheet" href="./css/xadmin.css">
        <script src="./js/jquery.min.js"></script>
        <script type="text/javascript" src="./lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="./js/xadmin.js"></script>
        <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
        <!--[if lt IE 9]>
            <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
            <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]--></head>

    <body>
        <div class="layui-fluid">
            <div class="layui-row">
                <form class="layui-form" lay-filter="example">
                    <div class="layui-form-item">
                        <label for="orderid" class="layui-form-label">
                            订单号</label>
                        <div class="layui-input-inline">
                            <input type="text" id="orderid" name="orderid" required="" lay-verify="orderid" autocomplete="off" class="layui-input" readonly></div>
                    </div>
                    <div class="layui-form-item">
                        <label for="aliTradeNo" class="layui-form-label"> 交易号</label>
                        <div class="layui-input-inline">
                            <input type="text" id="aliTradeNo" name="aliTradeNo" required="" lay-verify="aliTradeNo" autocomplete="off" class="layui-input" readonly></div>
                    </div>

                    <div class="layui-form-item">
                        <label for="patientName" class="layui-form-label">
                            就诊人</label>
                        <div class="layui-input-inline">
                            <input type="text" id="patientName" name="patientName" required="" lay-verify="patientName" autocomplete="off" class="layui-input"readonly></div>
                    </div>

                    <div class="layui-form-item">
                        <label for="userName" class="layui-form-label">
                            账号</label>
                        <div class="layui-input-inline">
                            <input type="text" id="userName" name="patientName" required="" lay-verify="userName" autocomplete="off" class="layui-input"readonly></div>
                    </div>

                    <div class="layui-form-item">
                        <label for="patientsPhone" class="layui-form-label"> 联系号码</label>
                        <div class="layui-input-inline">
                            <input type="text" id="patientsPhone" name="patientsPhone" required="" lay-verify="patientsPhone" autocomplete="off" class="layui-input"readonly></div>
                    </div>

                    <div class="layui-form-item">
                        <label for="hospitalName" class="layui-form-label">
                            医院</label>
                        <div class="layui-input-inline">
                            <input type="text" id="hospitalName" name="patientName" required="" lay-verify="hospitalName" autocomplete="off" class="layui-input"readonly></div>
                    </div>

                    <div class="layui-form-item">
                        <label for="departmentName" class="layui-form-label">
                            科室</label>
                        <div class="layui-input-inline">
                            <input type="text" id="departmentName" name="patientName" required="" lay-verify="departmentName" autocomplete="off" class="layui-input"readonly></div>
                    </div>

                    <div class="layui-form-item">
                        <label for="doctorName" class="layui-form-label">
                            医生</label>
                        <div class="layui-input-inline">
                            <input type="text" id="doctorName" name="patientName" required="" lay-verify="doctorName" autocomplete="off" class="layui-input"readonly></div>
                    </div>

                    <div class="layui-form-item">
                        <label for="status" class="layui-form-label">
                            状态</label>
                        <div class="layui-input-inline">
                            <input type="text" id="status" name="status" required="" lay-verify="statusName" autocomplete="off" class="layui-input"readonly></div>
                    </div>

                    <div class="layui-form-item">
                        <label for="creatTime" class="layui-form-label"> 创建时间</label>
                        <div class="layui-input-inline">
                            <input type="text" id="creatTime" name="creatTime" required="" lay-verify="creatTime" autocomplete="off" class="layui-input"readonly></div>
                    </div>

                    <div class="layui-form-item">
                        <label for="patientsTime" class="layui-form-label"> 预约时间</label>
                        <div class="layui-input-inline">
                            <input type="text" id="patientsTime" name="patientsTime" required="" lay-verify="patientsTime" autocomplete="off" class="layui-input"readonly></div>
                    </div>




                    <div class="layui-form-item">
                        <label for="illnessName" class="layui-form-label"> 疾病</label>
                        <div class="layui-input-inline">
                            <input type="text" id="illnessName" name="illnessName" required="" lay-verify="illnessName" autocomplete="off" class="layui-input"readonly></div>
                    </div>




                </form>
            </div>
        </div>
        <script>
            var id = window.location.search.substring(4);
            var token =  localStorage.getItem("token");
            var  head = new Headers();
            head.append('token',token);
            layui.use(['form','layer'], function() {
                var form = layui.form;
                var layer = layui.layer;
                $.ajax({
                    url: "/hospital/api/back/order/selectid",
                    type: "get",
                    dataType: "json",
                    headers: {
                        'token':token
                    },
                    data: {"id": id},
                    success: function (msg) {
                        var user = msg.data;
                        console.log(user);
                        //1未支付，2已支付，3已完成，4已取消
                        var s = null;

                        switch (user.status) {
                            case 1:
                                s = "未支付";break;
                            case 2:
                                s = "已支付";break;
                            case 3:
                                s = "已完成";break;
                            case 4:
                                s = "已取消";break;
                        }
                        //表单赋值
                        form.val('example', {
                            "orderid": user.orderid // "name": "value"
                            , "aliTradeNo": user.aliTradeNo
                            , "patientName": user.patientName
                            , "userName": user.userName
                            , "patientsPhone": user.patientsPhone
                            , "hospitalName": user.hospitalName
                            , "departmentName": user.departmentName
                            , "doctorName": user.doctorName
                            , "status": s
                            , "creatTime": user.creatTime
                            , "patientsTime": user.patientsTime
                            , "illnessName": user.illnessName
                        });
                    }
                });

            });


        </script>

    </body>

</html>